{include file="header.html"}
<script type="text/javascript">
    $(function () {
        $('#ad_form').validate({
            errorPlacement: function (error, element) {
                $(element).next('.field_notice').hide();
                $(element).after(error);
            },
            success: function (label) {
                label.addClass('right').text('OK!');
            },
            onkeyup: false,
            rules: {
                {if !$ad.ad_pic}
                ad_pic: {
                    required: true,
                    accept: 'gif|png|jpe?g'
                },
                {/if}
                ad_name: {
                    required: true,
                }
            },
            messages: {
                {if !$ad.ad_pic}
                ad_pic: {
                    required: '{$lang.ad_logo_empty}',
                    accept: '{$lang.limit_img}'
                },
                {/if}
                ad_name: {
                    required: '{$lang.ad_name_empty}',
                }
            }
        });
    });
</script>
<div id="rightTop">
    <p>{$lang.ad}</p>
    <ul class="subnav">
        <li><a class="btn1" href="index.php?app=app_ad">{$lang.manage}</a></li>
        <li><span>{$lang.edit}</span></li>
    </ul>
</div>

<div class="info">
    <form method="post" enctype="multipart/form-data" id="ad_form">
        <table class="infoTable">
            <tr>
                <th class="paddingT15">
                    {$lang.ad_type}:</th>
                <td class="paddingT15 wordSpacing5">
                    {$ad.ad_type}
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.ad_name}:
                </th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput2" id="ad_name" type="text" name="ad_name" value="{$ad.ad_name|escape}" /> <label class="field_notice">{$lang.ad_name}</label>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.ad_pic}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableFile2" id="ad_pic" type="file" name="ad_pic" />
                    <label class="field_notice">{$lang.limit_img}</label>
                </td>
            </tr>
            {if $ad.ad_pic}
            <tr>
                <th class="paddingT15">
                </th>
                <td class="paddingT15 wordSpacing5">
                    <img src="{$ad.ad_pic}?{$random_number}" class="makesmall" max_width="120" max_height="90" />
                </td>
            </tr>
            {/if}
            <tr>
                <th class="paddingT15">
                    {$lang.ad_description}:</th>
                <td class="paddingT15 wordSpacing5">
                    {$ad.ad_description}
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.store_id}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="sort_order" id="store_id" type="text" name="store_id" value="{$ad.store_id}" />
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    {$lang.goods_id}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="sort_order" id="goods_id" type="text" name="goods_id" value="{$ad.goods_id}" />
                </td>
            </tr>
            <tr>
                <th></th>
                <td class="ptb20">
                    <input class="formbtn" type="submit" name="Submit" value="{$lang.submit}" />
                    <input class="formbtn" type="reset" name="Submit2" value="{$lang.reset}" />
                </td>
            </tr>
        </table>
    </form>
</div>
{include file="footer.html"}
